package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.EquipBean;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class EquipSelectService
{
  public StateBean equipAdd(String paramString1, String paramString2, String paramString3, String paramString4, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR>" + "<TYPE>ADManageUser</TYPE></HEAD>" + "<BODY><BID>" + paramString2 + "</BID>" + "<Pwd>" + paramString3 + "</Pwd><Nick>" + paramString4 + "</Nick></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean equipAddCmd(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>ADCmd</TYPE>" + "</HEAD><BODY><BID>" + paramString2 + "</BID><STTM>" + GetDateTime.getDateTime() + "</STTM><Type>" + paramString3 + "</Type></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean equipDel(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR>" + "<TYPE>DLManageUser</TYPE></HEAD>" + "<BODY><BID>" + paramString2 + "</BID></BODY></MSG>";
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Logger.d("admin", "del-device-msg:" + str1);
    Logger.d("admin", "del-device-str:" + str2);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public List<EquipBean> getQTopWrite(String paramString, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    EquipBean localEquipBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString + "</SNDR> " + "<TYPE>RQManageUser</TYPE></HEAD>" + "<BODY><UserID>" + paramString + "</UserID></BODY></MSG>";
    String str2 = localMsgService.sendMessage(paramString, str1, paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject2 = localXmlPullParser;
      Logger.d("xjf", "rqusers-msg:" + str1);
      Logger.d("xjf", "rqusers-str:" + str2);
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("EquNums"))
      {
        new RqSP().setMobileCount(((XmlPullParser)localObject2).nextText());
        ((XmlPullParser)localObject2).nextTag();
      }
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localEquipBean = new EquipBean();
      if (localEquipBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("BID"))
        {
          localEquipBean.setUserName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Nick"))
        {
          localEquipBean.setUserNick(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("IsOnline"))
        {
          localEquipBean.setIsOnline(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("taocan"))
        {
          localEquipBean.setTaocan(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("EquipType"))
        {
          localEquipBean.setEquipType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("ManageType"))
        {
          localEquipBean.setMnageType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("UserId"))
        {
          localEquipBean.setUserId(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("list")) && (localObject1 != null) && (localEquipBean != null))
          {
            ((List)localObject1).add(localEquipBean);
            localEquipBean = null;
          }
        }
    }
  }

  public StateBean udEquipNum(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <TYPE>" + "UDEquip </TYPE></HEAD>" + "<BODY>" + "<OldId>" + paramString2 + "</OldId>" + "<NewId>" + paramString3 + "</NewId>" + "</BODY></MSG>";
    Logger.i("xjf", "--udEquipNum,,,msg--" + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Logger.i("xjf", "--udEquipNum,,,str--" + str2);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.EquipSelectService
 * JD-Core Version:    0.6.2
 */